<template>
	<view class="list pl30 pr30" v-if="list.length>0">
		<view class="item line d-f pt60 pb60" v-for="(item, index) in list" :key="index"
			@click="jump(`/pages/preview/detail?id=${item.id}`)">
			<view class="left d-b-s d-c flex-1">
				<view class="title f30 vertical2">{{ item.title }}</view>
				<view class="time f28">{{ item.updatetime }}</view>
			</view>
			<view class="right">
				<image :src="item.image" mode="aspectFill" class="br20"></image>
			</view>
		</view>
	</view>
	<u-empty v-else text="列表为空" marginTop="30vh"></u-empty>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			};
		},
		onLoad() {
			this.getList();
		},
		methods: {
			async getList() {
				const res = await this.$request({ url: this.$api.plist, data: { view: 1 } });
				if (res.code == 1) {
					this.list = this.list.concat(res.data);
					this.page++;
				}
			},
		},
	};
</script>

<style scoped lang="scss">
	.list {
		.item {
			.right {
				image {
					width: 280rpx;
					height: 160rpx;
				}
			}
		}
	}
</style>